/*
 * @Description: 主组件
 * @Author: gengzhaoji
 */
import { useRoutes } from 'react-router-dom';
import Fn from './fn';

function RouterWaiter({ routes, onRouteBefore, loading }) {
	const fn = new Fn({
		routes,
		onRouteBefore,
		loading
	});
	const reactRoutes = fn.transformRoutes();
	return useRoutes(reactRoutes);
}

export default RouterWaiter;
